package mao.thinkinjava.concurency.proxy;

import java.lang.reflect.Proxy;

public class SimpleProxyDemo {
    public static void main(String[] args) {
        RealClass real = new RealClass();
        real.doElseThing();
        real.doSomething();
        //
        Interface inter = (Interface) Proxy.newProxyInstance(Interface.class.getClassLoader(), new Class[]{Interface.class},
                new DynamicProxy(real));
        System.out.println(DynamicProxy.class);
        inter.doElseThing();
        inter.doElseThing();
    }
}
